import { GET, UPLOAD, POST } from '../../request';
import { Res } from '../../common';
import * as Types from './index.d';

/**
 * 获取我的活动列表
 * @returns
 */
export const getMyActivity = (): Promise<Res<Types.IGetMyActivityRes>> => {
  return GET('/api/my_topic');
};
/**
 * 获取我的活动详情
 * @param params
 * @returns
 */
export const getMyActivityDetail = (
  params: Types.IGetMyActivityDetailParams,
): Promise<Res<Types.IGetMyActivitydDetailRes>> => {
  return GET('/api/detail_topic', { ...params });
};
/**
 * 获取我的收获地址列表
 * @returns
 */
export const getAddressList = (): Promise<Res<any>> => {
  return GET('/api/get_user_address');
};

/**
 * 报名活动
 * @returns
 */
export const enrollActivity = (params: Types.IEnrollActivityParams): Promise<Res<any>> => {
  return GET('/api/add_topic', {
    ...params,
  });
};
/**
 * 增加地址
 * @param params
 * @returns
 */
export const addAddressInfo = (params: Types.IaddAddressParams): Promise<Res<any>> => {
  return GET('/api/add_user_address', {
    ...params,
  });
};
/**
 * 编辑地址
 * @param params
 * @returns
 */
export const editAddressInfo = (params: Types.IeditAddressParams): Promise<Res<any>> => {
  return GET('/api/edit_user_address', {
    ...params,
  });
};

/**
 * 查询老年卡绑定信息
 * @param params
 * @returns
 */
export const getOldCardInfo = (): Promise<Res<any>> => {
  return GET('/api/authentication_status');
};

/**
 * 上传身份证【POST请求】
 * card_img_font_side
 * card_img_back_side
 * @param params
 * @returns
 */
export const postIDCard = (params: any): Promise<Res<any>> => {
  return POST('/api/add_card_img', params);
};
/**
 * 上传老年卡【POST请求】
 * old_card_img_font_side
 * old_card_img_back_side
 * @param params
 * @returns
 */
export const postOldIDCard = (params: any): Promise<Res<any>> => {
  return POST('/api/add_old_card_img', params);
};

/**
 * 关联亲属信息
 * name=liu&gender=2&mobile=1737373737
 * @param params
 * @returns
 */
export const adduserLineal = (params: any): Promise<Res<any>> => {
  return GET('/api/add_user_lineal', params);
};

/**
 * 获取关联亲属信息
 * name=liu&gender=2&mobile=1737373737
 * @param params
 * @returns
 */
export const getUserLinealDetail = (): Promise<Res<any>> => {
  return GET('/api/getuser3status');
};

// api/?

/**
 * 上传图片
 * @param img
 * @returns
 */
export const uploadImg = (params: any): Promise<Res<any>> => {
  return UPLOAD('/api/up_img', params);
};

/**
 * 会员卡权益
 */
export const getPackageList = () => {
  return GET('/api/pake_list');
};

/**
 * 会员卡权益
 */
export const getUserPackageList = () => {
  return GET('/api/user_pake_list');
};
/**
 * 会员卡权益
 */
export const getRemainList = () => {
  return GET('/api/user_pake_list');
};
